<?php
$alias = "verano-2012";
$tplname = $alias.".tpl";
$query = "SELECT t.id, t.goto, c.title, c.title2, c.content FROM tour_content c JOIN tours t ON c.tour_id = t.id WHERE t.alias = '".$alias."' AND c.language = '".$lang."'";
if ($res = $db->runQuery($query)) {
	$row = $db->getRow($res);
	$tourId = $row["id"];
	$pagetitle = utf8_encode($row["title"]);
	$title2 = utf8_encode($row["title2"]);
	$goto = $row["goto"];
	$content->assign("tourid", $tourId);
	$content->assign("title", utf8_encode($row["title"]).(!empty($title2) ? " \"".$title2."\"" : ""));
	$content->assign("formaction", SECURE_URL.$lang."/reservations/");
	$content->assign("bookonlinelabel", $content->langmsg["bookonlinelabel"]);
	$content->assign("contacturl", BASE_URL.$lang."/contact/");
	$content->assign("goto", $goto);

	$imgArray = array();
	for ($i=1; $i<=5; $i++) {
		$imgName = $alias . "-" . $i . ".jpg";
		$imgPath = dirname(__FILE__)."/../images/" . $imgName;
		if (file_exists($imgPath)) {
			$imgArray[] = $imgName;
		}
	}
	$content->assign("images", $imgArray);

	$content2 = stripslashes(utf8_encode($row["content"]));
	$content2 = str_replace("#mapUrl#", $content->getBasePath().IMAGES_URL."mapa-caminos.jpg", $content2);
	$content->assign("content", $content2);
}
?>
